package com.cgw.dmplt.common;

import java.util.ArrayList;
import java.util.List;

public class PageBean<T> extends BaseDomain{

	private List<T> pageList;
	
	private int totalRows;
	private int totalPages;
	
	public PageBean(){};
	
	
	public PageBean(List<T> pageList,int totalRows,int curentPage){
		this.pageList=pageList;
		this.totalRows=totalRows;
		setCurentPage(curentPage);
		initPageInfo();
		
	}

	
	private void initPageInfo(){
		this.totalPages=totalRows%getPageSize()>0 ? totalRows/getPageSize()+1:totalRows/getPageSize();
	}

	public static void main(String[] args) {
//		PageBean page=new PageBean(new ArrayList(),90,10);
//		
//		System.out.println(page.getTotalPages());
	}
	
	public List<T> getPageList() {
		return this.pageList;
	}


	public void setPageList(List<T> pageList) {
		this.pageList = pageList;
	}


	public int getTotalRows() {
		return this.totalRows;
	}


	public void setTotalRows(int totalRows) {
		this.totalRows = totalRows;
	}


	public int getTotalPages() {
		return this.totalPages;
	}


	public void setTotalPages(int totalPages) {
		this.totalPages = totalPages;
	}

}
